<?php

/**
 * phorum actions.
 *
 * @package    IPLIFE
 * @subpackage phorum
 * @author     alexey.shapran@gmail.com
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class phorumComponents extends sfComponents
{
	/**
	 * Executes index action
	 *
	 * @param sfRequest $request A request object
	 */
	public function executeLasttentopics(sfWebRequest $request)
	{
		$query = 'SELECT t.id, t.subject, t.last_post
				  FROM for_topics AS t
				  ORDER BY t.last_post DESC
				  LIMIT 0,6';	

		$con = Doctrine_Manager::getInstance()->connection();

		$st = $con->execute($query);
		
		$this->topics = $st->fetchAll();
	}
}
